﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AgendaManager.AgendaService;

namespace AgendaManager
{
    public partial class frmNuevoInforme : Form
    {
        public InformeSemanal InformeSemanal { get; set; }
        
        //ToDo: Borrar
        //AgendaService.Service1 ws = new AgendaService.Service1();

        public frmNuevoInforme()
        {
            InitializeComponent();
        }

        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (txNombre.Text != string.Empty)
            {
                InformeSemanal.Nombre = txNombre.Text;

                InformeSemanal = ConnectHelper.ws.NuevoInformeSemanal(InformeSemanal);

                MessageBox.Show("El Informe Semanal ha sido creado exitosamente.",
                                "Nuevo Informe Semanal.",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);

                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
        }

        private void btnCancelar_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }
    }
}
